<!DOCTYPE html>
<html class="x-admin-sm">
<#include "../layout/meta.ftl">
<body class="layui-layout-body">
<style>
    .layui-form-pane .layui-form-label {
        width: 150px;
    }

    .layui-input, .layui-textarea {
        width: 90%;
    }
</style>
<div class="layui-container" style="margin-top: 15px">
    <div class="layui-col-md12" style="margin-top: 10px;">
        <div class="layui-card">
            <div class="layui-card-header"><b style="font-size: 20px">项目描述</b></div>
            <div class="layui-card-body" id="service-status">
                <form action="/project/addProject" method="post" class="layui-form layui-form-pane">
                    <input type="hidden" id="input-name" name="uuid" value="${(detail.uuid)!''}">
                    <div class="layui-form-item">
                        <label class="layui-form-label">项目名称</label>
                        <div class="layui-input-block">
                            <input type="text" name="name" value="${(detail.name)!''}" lay-verify="required"
                                   placeholder="请输入项目名称" class="layui-input">
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <div class="layui-block">
                            <label class="layui-form-label">Dockerfile 名字</label>
                            <div class="layui-input-block">
                                <input type="text" name="dockerFileName" lay-verify="required"
                                       placeholder="请输入Dockerfile 名字" value="${(detail.dockerFileName)!''}"
                                       class="layui-input">
                            </div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-block">
                            <label class="layui-form-label">Dockerfile 路径</label>
                            <div class="layui-input-block">
                                <input type="text" name="dockerFilePath" lay-verify="required"
                                       placeholder="请使用绝对路径 abs:/data/xxx/" value="${(detail.dockerFilePath)!''}"
                                       class="layui-input">
                            </div>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <div class="layui-block">
                            <label class="layui-form-label">Image Tag</label>
                            <div class="layui-input-block">
                                <input type="text" name="imageTag" lay-verify="required"
                                       placeholder="请使用(xxxx:latest)版本格式" value="${(detail.imageTag)!''}"
                                       class="layui-input">
                            </div>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <div class="layui-block">
                            <label class="layui-form-label">路径映射</label>
                            <div class="layui-input-block">
                                <input type="text" name="volume" value="${(detail.volume)!''}"
                                       placeholder="主机地址:容器地址 如：/data/log:/var/log1,/data/log:/var/log2"
                                       class="layui-input">
                            </div>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <div class="layui-block">
                            <label class="layui-form-label">端口映射</label>
                            <div class="layui-input-block">
                                <input type="text" name="ports" lay-verify="required"
                                       placeholder="主机端口:容器端口 如：9090:9090,8080,8080" value="${(detail.ports)!''}"
                                       class="layui-input">
                            </div>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <div class="layui-block">
                            <label class="layui-form-label">GIT地址</label>
                            <div class="layui-input-block">
                                <input type="text" name="url" lay-verify="required" placeholder="请输入GIT地址"
                                       value="${(detail.url)!''}" class="layui-input">
                            </div>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <div class="layui-block">
                            <label class="layui-form-label">Git分支</label>
                            <div class="layui-input-block">
                                <input type="text" name="branch" lay-verify="required" placeholder="请输入Git分支名称（如master）"
                                       value="${(detail.branch)!''}" class="layui-input">
                            </div>
                        </div>
                    </div>


                    <div class="layui-form-item">
                        <div class="layui-block">
                            <label class="layui-form-label">Git用户名</label>
                            <div class="layui-input-block">
                                <input type="text" name="userName" placeholder="输入Git用户名"
                                       value="${(detail.userName)!''}" class="layui-input">
                            </div>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <div class="layui-block">
                            <label class="layui-form-label">GIT密码</label>
                            <div class="layui-input-block">
                                <input type="password" name="password" placeholder="输入Git密码"
                                       value="${(detail.password)!''}" class="layui-input">
                            </div>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <div class="layui-block">
                            <label class="layui-form-label">仓库私钥</label>
                            <div class="layui-input-block">
                                <textarea name="privateKey" rows="5" style="height: auto"
                                          placeholder="仓库私钥(仓库私钥和上面的账号 二选一 注意：使用仓库私钥模式，GIT地址应该是用 git@xxx.xx/xxxx)"
                                          class="layui-textarea">${(detail.privateKey)!''}</textarea>
                            </div>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <div class="layui-block">
                            <label class="layui-form-label">集群负载数</label>
                            <div class="layui-input-block">
                                <input type="text" name="size" placeholder="输入集群负载数"
                                       value="${(detail.size)!''}" class="layui-input">
                                <input type="hidden" name="serviceId"
                                       value="${(detail.serviceId)!''}" class="layui-input">
                            </div>
                        </div>
                    </div>


                    <div class="layui-form-item" style="width: 100%;">
                        <div style="width:150px;margin: auto">
                            <button type="submit" class="layui-btn" lay-submit="" lay-filter="demo1">立即提交</button>
                        </div>
                    </div>

                </form>
            </div>
        </div>
    </div>

</div>
<script>
    //JavaScript代码区域
    layui.use(['element', 'form'], function () {
        let element = layui.element, form = layui.form;
    });
</script>
</body>
</html>